package com.easydisk.file.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.easydisk.file.model.entity.Share;
import com.easydisk.file.model.vo.UserFileVO;
import com.easydisk.file.model.vo.UserShareDetailVO;
import com.easydisk.file.model.vo.UserShareSimpleDetailVO;
import com.easydisk.file.model.vo.UserShareUrlVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 用户分享文件表 服务类
 * </p>
 *
 * @author word
 * @since 2023-09-08
 */
public interface ShareService extends IService<Share> {


    void refreshShareStatus(List<Long> fileIds);

    UserShareUrlVO addShare(String shareName, Integer shareType, Integer shareDayType,
                            String shareFileIds, Long userId);


    /**
     * 查询分享列表
     */
    List<UserShareUrlVO> shareList(Long userId);

    /**
     * 取消分享(支持批量)
     */
    void cancelShares(String shareIds, Long userId);

    /**
     * 获取分享详情
     */
    UserShareDetailVO getShareDetail(Long shareId);

    /**
     * 获取简单分享详情
     */
    UserShareSimpleDetailVO getShareSimpleDetail(Long shareId);


    String checkShareCode(Long shareId, String shareCode);

    List<UserFileVO> getShareUserFileList(Long shareId, Long parentId);

    /**
     * 保存至我的网盘
     */
    void addShareToNetDisk(Long shareId, String fileIds, Long targetParentId, Long userId);

    /**
     * 分享文件下载
     */
    void downloadShare(Long shareId, Long fileId, HttpServletResponse response);


}
